<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //我们要注册一个会员，首先先新建两个单类
        //姓名类
        var Name =  function(name){
            //下面会形成闭包
            //对this进行baocun
            let self = this
            //立即hanshu 
            (function(){
                self.wholename = name
                //对姓和名进行切割
                //对首次出现空格的地方进行检测
                if(name.indexOf(' ') > -1){
                    self.firstname = name.slice(0,name,indexOf(' '))
                    self.lastname = name.slice(indexOf(' '))
                }
            })(name,self)
        }
         //会员种类
         var member = function(){
             
         }
    </script>
</body>
</html>